<? $this->headTitle('Log Viewer - Dates'); ?>
<div>
    <h1><?= $this->escape($this->channel); ?> on <?= $this->escape($this->year) . '-' . $this->escape($this->month) .'-' . $this->escape($this->day); ?></h1>

    <? if (empty($this->year)) : ?>
    <ul>
        <? foreach ($this->data as $year => $monthArray) : ?>
        <li>
            <a href="<?= $this->url(array('year' => $year), 'logs.view.channel') ?>"><?= $year; ?></a>
        </li>
        <? endforeach; ?>
    </ul>
    <? endif; ?>

    <? if (!empty($this->year) && empty($this->month)) : ?>
    <ul>
        <? foreach ($this->data as $month => $dayArray) : ?>
        <li>
            <a href="<?= $this->url(array('year' => $this->year, 'month' => $month), 'logs.view.channel') ?>"><?= $month; ?></a>
        </li>
        <? endforeach; ?>
    </ul>
    <? endif; ?>

    <? if (!empty($this->year) && !empty($this->month)) : ?>
    <ul>
        <? foreach ($this->data as $day) : ?>
        <li>
            <a href="<?= $this->url(array('year' => $this->year, 'month' => $this->month, 'day' => $day), 'logs.view.channel') ?>"><?= $day; ?></a>
        </li>
        <? endforeach; ?>
    </ul>
    <? endif; ?>
</div>